import {getObjForm} from '@/api/activiti/oaconfig'
import {billDetail} from '@/api/bill'
export default {
  data() {
    return {
    }
  },
  created() {
  },
  computed: {
  },
  methods: {
    addNodeform(key, modalname) {
      let self = this
      getObjForm(key).then(response => {
          // this.transAvueOptionsToFormDesigner(response.data.data.formInfo).then(res => {
          //     res.column.map(item => {
          //         if (item.prop === 'title') {
          //             item.value = response.data.data.title
          //         }
          //     })
          //     self.widgetForm = res
          //     self.modal = true
          // })
          self.formObj.title = response.data.data.title
          self.formObj.code = key
          self.formObj.formType = response.data.data.formType
          self.option = JSON.parse(response.data.data.formInfo)
          if (modalname) {
            self[modalname] = true
          } else {
            self.modal = true
          }
        })
  },
  viewNodeForm(scope) {
      let self = this
      billDetail(scope.row.billId).then(response => {
          let formInfo = JSON.parse(response.data.data.formInfo)
          self.dataobj = response.data.data
          self.dataobj.formType = response.data.data.formType
          self.option1 = formInfo
          self.modal1 = true
      })
  },
  }
}
